home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacMemory.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  35.1 KB  |  1,477 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacMemory.a
  3. ;
  4. ;    Contains:    Memory Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__MACMEMORY__') = 'UNDEFINED' THEN
  18. __MACMEMORY__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28.  
  29.  
  30. maxSize                            EQU        $00800000            ;Max data block size is 8 megabytes
  31.  
  32. defaultPhysicalEntryCount        EQU        8
  33.  
  34.                                                             ; values returned from the GetPageState function 
  35. kPageInMemory                    EQU        0
  36. kPageOnDisk                        EQU        1
  37. kNotPaged                        EQU        2
  38.  
  39.                                                             ; masks for Zone->heapType field 
  40. k32BitHeap                        EQU        1                    ; valid in all Memory Managers 
  41. kNewStyleHeap                    EQU        2                    ; true if new Heap Manager is present 
  42. kNewDebugHeap                    EQU        4                    ; true if new Heap Manager is running in debug mode on this heap 
  43. ;  Note: The type "Size" moved to Types.h 
  44.  
  45.  
  46. Zone                    RECORD 0
  47. bkLim                     ds.l    1                ; offset: $0 (0)
  48. purgePtr                 ds.l    1                ; offset: $4 (4)
  49. hFstFree                 ds.l    1                ; offset: $8 (8)
  50. zcbFree                     ds.l    1                ; offset: $C (12)
  51. gzProc                     ds.l    1                ; offset: $10 (16)
  52. moreMast                 ds.w    1                ; offset: $14 (20)
  53. flags                     ds.w    1                ; offset: $16 (22)
  54. cntRel                     ds.w    1                ; offset: $18 (24)
  55. maxRel                     ds.w    1                ; offset: $1A (26)
  56. cntNRel                     ds.w    1                ; offset: $1C (28)
  57. heapType                 ds.b    1                ; offset: $1E (30)        ;  previously "maxNRel", now holds flags (e.g. k32BitHeap)
  58. unused                     ds.b    1                ; offset: $1F (31)
  59. cntEmpty                 ds.w    1                ; offset: $20 (32)
  60. cntHandles                 ds.w    1                ; offset: $22 (34)
  61. minCBFree                 ds.l    1                ; offset: $24 (36)
  62. purgeProc                 ds.l    1                ; offset: $28 (40)
  63. sparePtr                 ds.l    1                ; offset: $2C (44)
  64. allocPtr                 ds.l    1                ; offset: $30 (48)
  65. heapData                 ds.w    1                ; offset: $34 (52)
  66. sizeof                     EQU *                    ; size:   $36 (54)
  67.                         ENDR
  68. ; typedef struct Zone *                    THz
  69.  
  70. MemoryBlock                RECORD 0
  71. address                     ds.l    1                ; offset: $0 (0)
  72. count                     ds.l    1                ; offset: $4 (4)
  73. sizeof                     EQU *                    ; size:   $8 (8)
  74.                         ENDR
  75. LogicalToPhysicalTable    RECORD 0
  76. logical                     ds        MemoryBlock        ; offset: $0 (0)
  77. physical                 ds.b    8 * MemoryBlock.sizeof ; offset: $8 (8)
  78. sizeof                     EQU *                    ; size:   $48 (72)
  79.                         ENDR
  80. ; typedef short                         PageState
  81.  
  82. ; typedef short                         StatusRegisterContents
  83.  
  84. ;
  85. ; pascal Ptr GetApplLimit(void)
  86. ;
  87.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  88.         Macro
  89.         _GetApplLimit         &dest=(sp)
  90.             move.l            $0130,&dest
  91.         EndM
  92.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  93.         IMPORT_CFM_FUNCTION GetApplLimit
  94.     ENDIF
  95.  
  96. ;
  97. ; pascal THz SystemZone(void)
  98. ;
  99.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  100.         Macro
  101.         _SystemZone           &dest=(sp)
  102.             move.l            $02A6,&dest
  103.         EndM
  104.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  105.         IMPORT_CFM_FUNCTION SystemZone
  106.     ENDIF
  107.  
  108. ;
  109. ; pascal THz ApplicationZone(void)
  110. ;
  111.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  112.         Macro
  113.         _ApplicationZone      &dest=(sp)
  114.             move.l            $02AA,&dest
  115.         EndM
  116.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  117.         IMPORT_CFM_FUNCTION ApplicationZone
  118.     ENDIF
  119.  
  120. ;
  121. ; pascal Handle GZSaveHnd(void)
  122. ;
  123.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  124.         Macro
  125.         _GZSaveHnd            &dest=(sp)
  126.             move.l            $0328,&dest
  127.         EndM
  128.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  129.         IMPORT_CFM_FUNCTION GZSaveHnd
  130.     ENDIF
  131.  
  132. ;
  133. ; pascal Ptr TopMem(void)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  136.         Macro
  137.         _TopMem               &dest=(sp)
  138.             move.l            $0108,&dest
  139.         EndM
  140.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  141.         IMPORT_CFM_FUNCTION TopMem
  142.     ENDIF
  143.  
  144. ;
  145. ; pascal OSErr MemError(void)
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  148.         Macro
  149.         _MemError             &dest=(sp)
  150.             move.w            $0220,&dest
  151.         EndM
  152.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  153.         IMPORT_CFM_FUNCTION MemError
  154.     ENDIF
  155.  
  156.  
  157.  
  158. ;
  159. ; pascal THz GetZone(void )
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  162.         ; returns:
  163.         ;    THz             <= A0
  164.         _GetZone:    OPWORD    $A11A
  165.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION GetZone
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal Handle NewHandle(Size byteCount)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  173.         ; parameters:
  174.         ;    byteCount       => D0
  175.         ; returns:
  176.         ;    Handle          <= A0
  177.         _NewHandle:    OPWORD    $A122
  178.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION NewHandle
  180.     ENDIF
  181.  
  182. ;
  183. ; pascal Handle NewHandleSys(Size byteCount)
  184. ;
  185.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  186.         ; parameters:
  187.         ;    byteCount       => D0
  188.         ; returns:
  189.         ;    Handle          <= A0
  190.         _NewHandleSys:    OPWORD    $A522
  191.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  192.         IMPORT_CFM_FUNCTION NewHandleSys
  193.     ENDIF
  194.  
  195. ;
  196. ; pascal Handle NewHandleClear(Size byteCount)
  197. ;
  198.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  199.         ; parameters:
  200.         ;    byteCount       => D0
  201.         ; returns:
  202.         ;    Handle          <= A0
  203.         _NewHandleClear:    OPWORD    $A322
  204.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  205.         IMPORT_CFM_FUNCTION NewHandleClear
  206.     ENDIF
  207.  
  208. ;
  209. ; pascal Handle NewHandleSysClear(Size byteCount)
  210. ;
  211.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  212.         ; parameters:
  213.         ;    byteCount       => D0
  214.         ; returns:
  215.         ;    Handle          <= A0
  216.         _NewHandleSysClear:    OPWORD    $A722
  217.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  218.         IMPORT_CFM_FUNCTION NewHandleSysClear
  219.     ENDIF
  220.  
  221. ;
  222. ; pascal THz HandleZone(Handle h)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  225.         ; parameters:
  226.         ;    h               => A0
  227.         ; returns:
  228.         ;    THz             <= A0
  229.         _HandleZone:    OPWORD    $A126
  230.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION HandleZone
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal Handle RecoverHandle(Ptr p)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  238.         ; parameters:
  239.         ;    p               => A0
  240.         ; returns:
  241.         ;    Handle          <= A0
  242.         _RecoverHandle:    OPWORD    $A128
  243.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION RecoverHandle
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal Handle RecoverHandleSys(Ptr p)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         ; parameters:
  252.         ;    p               => A0
  253.         ; returns:
  254.         ;    Handle          <= A0
  255.         _RecoverHandleSys:    OPWORD    $A528
  256.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION RecoverHandleSys
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal Ptr NewPtr(Size byteCount)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         ; parameters:
  265.         ;    byteCount       => D0
  266.         ; returns:
  267.         ;    Ptr             <= A0
  268.         _NewPtr:    OPWORD    $A11E
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION NewPtr
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal Ptr NewPtrSys(Size byteCount)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         ; parameters:
  278.         ;    byteCount       => D0
  279.         ; returns:
  280.         ;    Ptr             <= A0
  281.         _NewPtrSys:    OPWORD    $A51E
  282.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION NewPtrSys
  284.     ENDIF
  285.  
  286. ;
  287. ; pascal Ptr NewPtrClear(Size byteCount)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  290.         ; parameters:
  291.         ;    byteCount       => D0
  292.         ; returns:
  293.         ;    Ptr             <= A0
  294.         _NewPtrClear:    OPWORD    $A31E
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION NewPtrClear
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal Ptr NewPtrSysClear(Size byteCount)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         ; parameters:
  304.         ;    byteCount       => D0
  305.         ; returns:
  306.         ;    Ptr             <= A0
  307.         _NewPtrSysClear:    OPWORD    $A71E
  308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION NewPtrSysClear
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal THz PtrZone(Ptr p)
  314. ;
  315.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  316.         ; parameters:
  317.         ;    p               => A0
  318.         ; returns:
  319.         ;    THz             <= A0
  320.         _PtrZone:    OPWORD    $A148
  321.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  322.         IMPORT_CFM_FUNCTION PtrZone
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal long MaxBlock(void )
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  329.         ; returns:
  330.         ;    long            <= D0
  331.         _MaxBlock:    OPWORD    $A061
  332.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION MaxBlock
  334.     ENDIF
  335.  
  336. ;
  337. ; pascal long MaxBlockSys(void )
  338. ;
  339.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  340.         ; returns:
  341.         ;    long            <= D0
  342.         _MaxBlockSys:    OPWORD    $A461
  343.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION MaxBlockSys
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal long StackSpace(void )
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  351.         ; returns:
  352.         ;    long            <= D0
  353.         _StackSpace:    OPWORD    $A065
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION StackSpace
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal Handle NewEmptyHandle(void )
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         ; returns:
  363.         ;    Handle          <= A0
  364.         _NewEmptyHandle:    OPWORD    $A166
  365.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION NewEmptyHandle
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal Handle NewEmptyHandleSys(void )
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  373.         ; returns:
  374.         ;    Handle          <= A0
  375.         _NewEmptyHandleSys:    OPWORD    $A566
  376.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION NewEmptyHandleSys
  378.     ENDIF
  379.  
  380. ;
  381. ; pascal void HLock(Handle h)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  384.         ; parameters:
  385.         ;    h               => A0
  386.         _HLock:    OPWORD    $A029
  387.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION HLock
  389.     ENDIF
  390.  
  391. ;
  392. ; pascal void HUnlock(Handle h)
  393. ;
  394.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  395.         ; parameters:
  396.         ;    h               => A0
  397.         _HUnlock:    OPWORD    $A02A
  398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION HUnlock
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal void HPurge(Handle h)
  404. ;
  405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  406.         ; parameters:
  407.         ;    h               => A0
  408.         _HPurge:    OPWORD    $A049
  409.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  410.         IMPORT_CFM_FUNCTION HPurge
  411.     ENDIF
  412.  
  413. ;
  414. ; pascal void HNoPurge(Handle h)
  415. ;
  416.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  417.         ; parameters:
  418.         ;    h               => A0
  419.         _HNoPurge:    OPWORD    $A04A
  420.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION HNoPurge
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal void HLockHi(Handle h)
  426. ;
  427.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  428.         ; parameters:
  429.         ;    h               => A0
  430.         Macro
  431.         _HLockHi
  432.             dc.w                $A064
  433.             dc.w                $A029
  434.         EndM
  435.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION HLockHi
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  443.         Macro
  444.         _TempNewHandle
  445.             move.w              #$001D,-(sp)
  446.             dc.w                $A88F
  447.         EndM
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION TempNewHandle
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal Size TempMaxMem(Size *grow)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  456.         Macro
  457.         _TempMaxMem
  458.             move.w              #$0015,-(sp)
  459.             dc.w                $A88F
  460.         EndM
  461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION TempMaxMem
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal long TempFreeMem(void )
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  469.         Macro
  470.         _TempFreeMem
  471.             move.w              #$0018,-(sp)
  472.             dc.w                $A88F
  473.         EndM
  474.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION TempFreeMem
  476.     ENDIF
  477.  
  478. ;
  479. ; pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr)
  480. ;
  481.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  482.         _InitZone:    OPWORD    $A019
  483.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  484.         IMPORT_CFM_FUNCTION InitZone
  485.     ENDIF
  486.  
  487. ;
  488. ; pascal void SetZone(THz hz)
  489. ;
  490.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  491.         ; parameters:
  492.         ;    hz              => A0
  493.         _SetZone:    OPWORD    $A01B
  494.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  495.         IMPORT_CFM_FUNCTION SetZone
  496.     ENDIF
  497.  
  498. ;
  499. ; pascal Size CompactMem(Size cbNeeded)
  500. ;
  501.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  502.         ; parameters:
  503.         ;    cbNeeded        => D0
  504.         ; returns:
  505.         ;    Size            <= D0
  506.         _CompactMem:    OPWORD    $A04C
  507.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  508.         IMPORT_CFM_FUNCTION CompactMem
  509.     ENDIF
  510.  
  511. ;
  512. ; pascal Size CompactMemSys(Size cbNeeded)
  513. ;
  514.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  515.         ; parameters:
  516.         ;    cbNeeded        => D0
  517.         ; returns:
  518.         ;    Size            <= D0
  519.         _CompactMemSys:    OPWORD    $A44C
  520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  521.         IMPORT_CFM_FUNCTION CompactMemSys
  522.     ENDIF
  523.  
  524. ;
  525. ; pascal void PurgeMem(Size cbNeeded)
  526. ;
  527.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  528.         ; parameters:
  529.         ;    cbNeeded        => D0
  530.         _PurgeMem:    OPWORD    $A04D
  531.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  532.         IMPORT_CFM_FUNCTION PurgeMem
  533.     ENDIF
  534.  
  535. ;
  536. ; pascal void PurgeMemSys(Size cbNeeded)
  537. ;
  538.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  539.         ; parameters:
  540.         ;    cbNeeded        => D0
  541.         _PurgeMemSys:    OPWORD    $A44D
  542.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  543.         IMPORT_CFM_FUNCTION PurgeMemSys
  544.     ENDIF
  545.  
  546. ;
  547. ; pascal long FreeMem(void )
  548. ;
  549.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  550.         ; returns:
  551.         ;    long            <= D0
  552.         _FreeMem:    OPWORD    $A01C
  553.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  554.         IMPORT_CFM_FUNCTION FreeMem
  555.     ENDIF
  556.  
  557. ;
  558. ; pascal long FreeMemSys(void )
  559. ;
  560.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  561.         ; returns:
  562.         ;    long            <= D0
  563.         _FreeMemSys:    OPWORD    $A41C
  564.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  565.         IMPORT_CFM_FUNCTION FreeMemSys
  566.     ENDIF
  567.  
  568. ;
  569. ; pascal void ReserveMem(Size cbNeeded)
  570. ;
  571.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  572.         ; parameters:
  573.         ;    cbNeeded        => D0
  574.         _ReserveMem:    OPWORD    $A040
  575.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  576.         IMPORT_CFM_FUNCTION ReserveMem
  577.     ENDIF
  578.  
  579. ;
  580. ; pascal void ReserveMemSys(Size cbNeeded)
  581. ;
  582.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  583.         ; parameters:
  584.         ;    cbNeeded        => D0
  585.         _ReserveMemSys:    OPWORD    $A440
  586.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  587.         IMPORT_CFM_FUNCTION ReserveMemSys
  588.     ENDIF
  589.  
  590. ;
  591. ; pascal Size MaxMem(Size *grow)
  592. ;
  593.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  594.         _MaxMem:    OPWORD    $A11D
  595.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  596.         IMPORT_CFM_FUNCTION MaxMem
  597.     ENDIF
  598.  
  599. ;
  600. ; pascal Size MaxMemSys(Size *grow)
  601. ;
  602.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  603.         _MaxMemSys:    OPWORD    $A51D
  604.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  605.         IMPORT_CFM_FUNCTION MaxMemSys
  606.     ENDIF
  607.  
  608. ;
  609. ; pascal void SetGrowZone(GrowZoneUPP growZone)
  610. ;
  611.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  612.         ; parameters:
  613.         ;    growZone        => A0
  614.         _SetGrowZone:    OPWORD    $A04B
  615.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  616.         IMPORT_CFM_FUNCTION SetGrowZone
  617.     ENDIF
  618.  
  619. ;
  620. ; pascal void MoveHHi(Handle h)
  621. ;
  622.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  623.         ; parameters:
  624.         ;    h               => A0
  625.         _MoveHHi:    OPWORD    $A064
  626.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  627.         IMPORT_CFM_FUNCTION MoveHHi
  628.     ENDIF
  629.  
  630. ;
  631. ; pascal void DisposePtr(Ptr p)
  632. ;
  633.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  634.         ; parameters:
  635.         ;    p               => A0
  636.         _DisposePtr:    OPWORD    $A01F
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION DisposePtr
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal Size GetPtrSize(Ptr p)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  645.         _GetPtrSize:    OPWORD    $A021
  646.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  647.         IMPORT_CFM_FUNCTION GetPtrSize
  648.     ENDIF
  649.  
  650. ;
  651. ; pascal void SetPtrSize(Ptr p, Size newSize)
  652. ;
  653.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  654.         ; parameters:
  655.         ;    p               => A0
  656.         ;    newSize         => D0
  657.         _SetPtrSize:    OPWORD    $A020
  658.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  659.         IMPORT_CFM_FUNCTION SetPtrSize
  660.     ENDIF
  661.  
  662. ;
  663. ; pascal void DisposeHandle(Handle h)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  666.         ; parameters:
  667.         ;    h               => A0
  668.         _DisposeHandle:    OPWORD    $A023
  669.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  670.         IMPORT_CFM_FUNCTION DisposeHandle
  671.     ENDIF
  672.  
  673. ;
  674. ; pascal void SetHandleSize(Handle h, Size newSize)
  675. ;
  676.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  677.         ; parameters:
  678.         ;    h               => A0
  679.         ;    newSize         => D0
  680.         _SetHandleSize:    OPWORD    $A024
  681.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  682.         IMPORT_CFM_FUNCTION SetHandleSize
  683.     ENDIF
  684.  
  685. ;  
  686. ;    NOTE
  687. ;    
  688. ;    GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  689. ;    in case of an error, but the traps actually return an error code in D0.
  690. ;    The glue sets D0 to 0 if an error occured.
  691. ;
  692.  
  693. ;
  694. ; pascal Size GetHandleSize(Handle h)
  695. ;
  696.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  697.         _GetHandleSize:    OPWORD    $A025
  698.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  699.         IMPORT_CFM_FUNCTION GetHandleSize
  700.     ENDIF
  701.  
  702. ;
  703. ; pascal Size InlineGetHandleSize(Handle h)
  704. ;
  705.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  706.         ; parameters:
  707.         ;    h               => A0
  708.         ; returns:
  709.         ;    Size            <= D0
  710.         _InlineGetHandleSize:    OPWORD    $A025
  711.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  712.         IMPORT_CFM_FUNCTION InlineGetHandleSize
  713.     ENDIF
  714.  
  715. ;
  716. ; pascal void ReallocateHandle(Handle h, Size byteCount)
  717. ;
  718.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  719.         ; parameters:
  720.         ;    h               => A0
  721.         ;    byteCount       => D0
  722.         _ReallocateHandle:    OPWORD    $A027
  723.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  724.         IMPORT_CFM_FUNCTION ReallocateHandle
  725.     ENDIF
  726.  
  727. ;
  728. ; pascal void ReallocateHandleSys(Handle h, Size byteCount)
  729. ;
  730.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  731.         ; parameters:
  732.         ;    h               => A0
  733.         ;    byteCount       => D0
  734.         _ReallocateHandleSys:    OPWORD    $A427
  735.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  736.         IMPORT_CFM_FUNCTION ReallocateHandleSys
  737.     ENDIF
  738.  
  739. ;
  740. ; pascal void EmptyHandle(Handle h)
  741. ;
  742.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  743.         ; parameters:
  744.         ;    h               => A0
  745.         _EmptyHandle:    OPWORD    $A02B
  746.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  747.         IMPORT_CFM_FUNCTION EmptyHandle
  748.     ENDIF
  749.  
  750. ;
  751. ; pascal void HSetRBit(Handle h)
  752. ;
  753.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  754.         ; parameters:
  755.         ;    h               => A0
  756.         _HSetRBit:    OPWORD    $A067
  757.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  758.         IMPORT_CFM_FUNCTION HSetRBit
  759.     ENDIF
  760.  
  761. ;
  762. ; pascal void HClrRBit(Handle h)
  763. ;
  764.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  765.         ; parameters:
  766.         ;    h               => A0
  767.         _HClrRBit:    OPWORD    $A068
  768.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  769.         IMPORT_CFM_FUNCTION HClrRBit
  770.     ENDIF
  771.  
  772. ;
  773. ; pascal SInt8 HGetState(Handle h)
  774. ;
  775.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  776.         ; parameters:
  777.         ;    h               => A0
  778.         ; returns:
  779.         ;    SInt8           <= D0
  780.         _HGetState:    OPWORD    $A069
  781.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  782.         IMPORT_CFM_FUNCTION HGetState
  783.     ENDIF
  784.  
  785. ;
  786. ; pascal void HSetState(Handle h, SInt8 flags)
  787. ;
  788.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  789.         ; parameters:
  790.         ;    h               => A0
  791.         ;    flags           => D0
  792.         _HSetState:    OPWORD    $A06A
  793.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  794.         IMPORT_CFM_FUNCTION HSetState
  795.     ENDIF
  796.  
  797. ;
  798. ; pascal void PurgeSpace(long *total, long *contig)
  799. ;
  800.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  801.         _PurgeSpace:    OPWORD    $A162
  802.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  803.         IMPORT_CFM_FUNCTION PurgeSpace
  804.     ENDIF
  805.  
  806. ;    PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  807. ;    on classic 68K.  The are the same as PurgeSpace() but return just
  808. ;    one value (either total space purgable or contiguous space purgable).
  809. ;
  810.  
  811. ;
  812. ; pascal long PurgeSpaceTotal(void )
  813. ;
  814.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  815.         ; returns:
  816.         ;    long            <= A0
  817.         _PurgeSpaceTotal:    OPWORD    $A062
  818.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  819.         IMPORT_CFM_FUNCTION PurgeSpaceTotal
  820.     ENDIF
  821.  
  822. ;
  823. ; pascal long PurgeSpaceContiguous(void )
  824. ;
  825.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  826.         ; returns:
  827.         ;    long            <= D0
  828.         _PurgeSpaceContiguous:    OPWORD    $A062
  829.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  830.         IMPORT_CFM_FUNCTION PurgeSpaceContiguous
  831.     ENDIF
  832.  
  833. ;
  834. ; pascal long PurgeSpaceSysTotal(void )
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  837.         ; returns:
  838.         ;    long            <= A0
  839.         _PurgeSpaceSysTotal:    OPWORD    $A562
  840.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  841.         IMPORT_CFM_FUNCTION PurgeSpaceSysTotal
  842.     ENDIF
  843.  
  844. ;
  845. ; pascal long PurgeSpaceSysContiguous(void )
  846. ;
  847.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  848.         ; returns:
  849.         ;    long            <= D0
  850.         _PurgeSpaceSysContiguous:    OPWORD    $A562
  851.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  852.         IMPORT_CFM_FUNCTION PurgeSpaceSysContiguous
  853.     ENDIF
  854.  
  855.  
  856. ; *****************************************************************************
  857. ;
  858. ;    The routines: 
  859. ;
  860. ;        BlockMoveUncached
  861. ;        BlockMoveDataUncached
  862. ;        BlockZero
  863. ;        BlockZeroUncached
  864. ;    
  865. ;    are intended for developers writing drivers. They do not exist in 
  866. ;    “InterfaceLib.” You must link with “DriverServicesLib” to access them.
  867. ;    
  868. ;    But since BlockMove and BlockMoveData exist in both “InterfaceLib” and
  869. ;    “DriverServicesLib”, you cannot link with both libraries.
  870. ;    
  871. ;****************************************************************************
  872.  
  873. ;
  874. ; pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
  875. ;
  876.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  877.         ; parameters:
  878.         ;    srcPtr          => A0
  879.         ;    destPtr         => A1
  880.         ;    byteCount       => D0
  881.         _BlockMove:    OPWORD    $A02E
  882.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  883.         IMPORT_CFM_FUNCTION BlockMove
  884.     ENDIF
  885.  
  886. ;
  887. ; pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
  888. ;
  889.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  890.         ; parameters:
  891.         ;    srcPtr          => A0
  892.         ;    destPtr         => A1
  893.         ;    byteCount       => D0
  894.         _BlockMoveData:    OPWORD    $A22E
  895.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  896.         IMPORT_CFM_FUNCTION BlockMoveData
  897.     ENDIF
  898.  
  899. ;
  900. ; extern void BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount)
  901. ;
  902.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  903.         IMPORT_CFM_FUNCTION BlockMoveUncached
  904.     ENDIF
  905.  
  906. ;
  907. ; extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount)
  908. ;
  909.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  910.         IMPORT_CFM_FUNCTION BlockMoveDataUncached
  911.     ENDIF
  912.  
  913. ;
  914. ; extern void BlockZero(void *destPtr, Size byteCount)
  915. ;
  916.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  917.         IMPORT_CFM_FUNCTION BlockZero
  918.     ENDIF
  919.  
  920. ;
  921. ; extern void BlockZeroUncached(void *destPtr, Size byteCount)
  922. ;
  923.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  924.         IMPORT_CFM_FUNCTION BlockZeroUncached
  925.     ENDIF
  926.  
  927.  
  928. ;
  929. ; pascal void MaxApplZone(void )
  930. ;
  931.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  932.         _MaxApplZone:    OPWORD    $A063
  933.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  934.         IMPORT_CFM_FUNCTION MaxApplZone
  935.     ENDIF
  936.  
  937. ;
  938. ; pascal void SetApplBase(void *startPtr)
  939. ;
  940.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  941.         ; parameters:
  942.         ;    startPtr        => A0
  943.         _SetApplBase:    OPWORD    $A057
  944.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  945.         IMPORT_CFM_FUNCTION SetApplBase
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal void MoreMasters(void )
  950. ;
  951.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  952.         _MoreMasters:    OPWORD    $A036
  953.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  954.         IMPORT_CFM_FUNCTION MoreMasters
  955.     ENDIF
  956.  
  957. ;
  958. ; pascal void SetApplLimit(void *zoneLimit)
  959. ;
  960.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  961.         ; parameters:
  962.         ;    zoneLimit       => A0
  963.         _SetApplLimit:    OPWORD    $A02D
  964.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  965.         IMPORT_CFM_FUNCTION SetApplLimit
  966.     ENDIF
  967.  
  968.  
  969.  
  970. ;
  971. ; pascal void InitApplZone(void )
  972. ;
  973.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  974.         _InitApplZone:    OPWORD    $A02C
  975.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  976.         IMPORT_CFM_FUNCTION InitApplZone
  977.     ENDIF
  978.  
  979.  
  980. ;   Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  
  981. ;
  982. ; pascal void TempHLock(Handle h, OSErr *resultCode)
  983. ;
  984.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  985.         Macro
  986.         _TempHLock
  987.             move.w              #$001E,-(sp)
  988.             dc.w                $A88F
  989.         EndM
  990.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  991.         IMPORT_CFM_FUNCTION TempHLock
  992.     ENDIF
  993.  
  994. ;
  995. ; pascal void TempHUnlock(Handle h, OSErr *resultCode)
  996. ;
  997.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  998.         Macro
  999.         _TempHUnlock
  1000.             move.w              #$001F,-(sp)
  1001.             dc.w                $A88F
  1002.         EndM
  1003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1004.         IMPORT_CFM_FUNCTION TempHUnlock
  1005.     ENDIF
  1006.  
  1007. ;
  1008. ; pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
  1009. ;
  1010.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1011.         Macro
  1012.         _TempDisposeHandle
  1013.             move.w              #$0020,-(sp)
  1014.             dc.w                $A88F
  1015.         EndM
  1016.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1017.         IMPORT_CFM_FUNCTION TempDisposeHandle
  1018.     ENDIF
  1019.  
  1020. ;
  1021. ; pascal Ptr TempTopMem(void )
  1022. ;
  1023.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1024.         Macro
  1025.         _TempTopMem
  1026.             move.w              #$0016,-(sp)
  1027.             dc.w                $A88F
  1028.         EndM
  1029.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1030.         IMPORT_CFM_FUNCTION TempTopMem
  1031.     ENDIF
  1032.  
  1033. ;
  1034. ; pascal OSErr HoldMemory(void *address, unsigned long count)
  1035. ;
  1036.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1037.         ; parameters:
  1038.         ;    address         => A0
  1039.         ;    count           => A1
  1040.         ; returns:
  1041.         ;    OSErr           <= D0
  1042.         Macro
  1043.         _HoldMemory
  1044.             moveq               #0,D0
  1045.             dc.w                $A05C
  1046.         EndM
  1047.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1048.         IMPORT_CFM_FUNCTION HoldMemory
  1049.     ENDIF
  1050.  
  1051. ;
  1052. ; pascal OSErr UnholdMemory(void *address, unsigned long count)
  1053. ;
  1054.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1055.         ; parameters:
  1056.         ;    address         => A0
  1057.         ;    count           => A1
  1058.         ; returns:
  1059.         ;    OSErr           <= D0
  1060.         Macro
  1061.         _UnholdMemory
  1062.             moveq               #1,D0
  1063.             dc.w                $A05C
  1064.         EndM
  1065.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1066.         IMPORT_CFM_FUNCTION UnholdMemory
  1067.     ENDIF
  1068.  
  1069. ;
  1070. ; pascal OSErr LockMemory(void *address, unsigned long count)
  1071. ;
  1072.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1073.         ; parameters:
  1074.         ;    address         => A0
  1075.         ;    count           => A1
  1076.         ; returns:
  1077.         ;    OSErr           <= D0
  1078.         Macro
  1079.         _LockMemory
  1080.             moveq               #2,D0
  1081.             dc.w                $A05C
  1082.         EndM
  1083.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1084.         IMPORT_CFM_FUNCTION LockMemory
  1085.     ENDIF
  1086.  
  1087. ;
  1088. ; pascal OSErr LockMemoryForOutput(void *address, unsigned long count)
  1089. ;
  1090.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1091.         ; parameters:
  1092.         ;    address         => A0
  1093.         ;    count           => A1
  1094.         ; returns:
  1095.         ;    OSErr           <= D0
  1096.         Macro
  1097.         _LockMemoryForOutput
  1098.             moveq               #10,D0
  1099.             dc.w                $A05C
  1100.         EndM
  1101.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1102.         IMPORT_CFM_FUNCTION LockMemoryForOutput
  1103.     ENDIF
  1104.  
  1105. ;
  1106. ; pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
  1107. ;
  1108.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1109.         ; parameters:
  1110.         ;    address         => A0
  1111.         ;    count           => A1
  1112.         ; returns:
  1113.         ;    OSErr           <= D0
  1114.         Macro
  1115.         _LockMemoryContiguous
  1116.             moveq               #4,D0
  1117.             dc.w                $A05C
  1118.         EndM
  1119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1120.         IMPORT_CFM_FUNCTION LockMemoryContiguous
  1121.     ENDIF
  1122.  
  1123. ;
  1124. ; pascal OSErr UnlockMemory(void *address, unsigned long count)
  1125. ;
  1126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1127.         ; parameters:
  1128.         ;    address         => A0
  1129.         ;    count           => A1
  1130.         ; returns:
  1131.         ;    OSErr           <= D0
  1132.         Macro
  1133.         _UnlockMemory
  1134.             moveq               #3,D0
  1135.             dc.w                $A05C
  1136.         EndM
  1137.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1138.         IMPORT_CFM_FUNCTION UnlockMemory
  1139.     ENDIF
  1140.  
  1141. ;
  1142. ; pascal OSErr MakeMemoryResident(void *address, unsigned long count)
  1143. ;
  1144.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1145.         ; parameters:
  1146.         ;    address         => A0
  1147.         ;    count           => A1
  1148.         ; returns:
  1149.         ;    OSErr           <= D0
  1150.         Macro
  1151.         _MakeMemoryResident
  1152.             moveq               #11,D0
  1153.             dc.w                $A05C
  1154.         EndM
  1155.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1156.         IMPORT_CFM_FUNCTION MakeMemoryResident
  1157.     ENDIF
  1158.  
  1159. ;
  1160. ; pascal OSErr ReleaseMemoryData(void *address, unsigned long count)
  1161. ;
  1162.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1163.         ; parameters:
  1164.         ;    address         => A0
  1165.         ;    count           => A1
  1166.         ; returns:
  1167.         ;    OSErr           <= D0
  1168.         Macro
  1169.         _ReleaseMemoryData
  1170.             moveq               #12,D0
  1171.             dc.w                $A05C
  1172.         EndM
  1173.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1174.         IMPORT_CFM_FUNCTION ReleaseMemoryData
  1175.     ENDIF
  1176.  
  1177. ;
  1178. ; pascal OSErr MakeMemoryNonResident(void *address, unsigned long count)
  1179. ;
  1180.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1181.         ; parameters:
  1182.         ;    address         => A0
  1183.         ;    count           => A1
  1184.         ; returns:
  1185.         ;    OSErr           <= D0
  1186.         Macro
  1187.         _MakeMemoryNonResident
  1188.             moveq               #13,D0
  1189.             dc.w                $A05C
  1190.         EndM
  1191.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1192.         IMPORT_CFM_FUNCTION MakeMemoryNonResident
  1193.     ENDIF
  1194.  
  1195. ;
  1196. ; pascal OSErr FlushMemory(void *address, unsigned long count)
  1197. ;
  1198.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1199.         ; parameters:
  1200.         ;    address         => A0
  1201.         ;    count           => A1
  1202.         ; returns:
  1203.         ;    OSErr           <= D0
  1204.         Macro
  1205.         _FlushMemory
  1206.             moveq               #14,D0
  1207.             dc.w                $A05C
  1208.         EndM
  1209.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1210.         IMPORT_CFM_FUNCTION FlushMemory
  1211.     ENDIF
  1212.  
  1213. ;
  1214. ; pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount)
  1215. ;
  1216.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1217.         Macro
  1218.         _GetPhysical
  1219.             moveq               #5,D0
  1220.             dc.w                $A05C
  1221.         EndM
  1222.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1223.         IMPORT_CFM_FUNCTION GetPhysical
  1224.     ENDIF
  1225.  
  1226. ;
  1227. ; pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
  1228. ;
  1229.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1230.         ; parameters:
  1231.         ;    userFunctionargument=> A0
  1232.         ;    argument        => D0
  1233.         ; returns:
  1234.         ;    OSErr           <= D0
  1235.         _DeferUserFn:    OPWORD    $A08F
  1236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1237.         IMPORT_CFM_FUNCTION DeferUserFn
  1238.     ENDIF
  1239.  
  1240. ;
  1241. ; pascal long DebuggerGetMax(void )
  1242. ;
  1243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1244.         ; returns:
  1245.         ;    long            <= D0
  1246.         Macro
  1247.         _DebuggerGetMax
  1248.             moveq               #0,D0
  1249.             dc.w                $A08D
  1250.         EndM
  1251.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1252.         IMPORT_CFM_FUNCTION DebuggerGetMax
  1253.     ENDIF
  1254.  
  1255. ;
  1256. ; pascal void DebuggerEnter(void )
  1257. ;
  1258.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1259.         Macro
  1260.         _DebuggerEnter
  1261.             moveq               #1,D0
  1262.             dc.w                $A08D
  1263.         EndM
  1264.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1265.         IMPORT_CFM_FUNCTION DebuggerEnter
  1266.     ENDIF
  1267.  
  1268. ;
  1269. ; pascal void DebuggerExit(void )
  1270. ;
  1271.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1272.         Macro
  1273.         _DebuggerExit
  1274.             moveq               #2,D0
  1275.             dc.w                $A08D
  1276.         EndM
  1277.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1278.         IMPORT_CFM_FUNCTION DebuggerExit
  1279.     ENDIF
  1280.  
  1281. ;
  1282. ; pascal void DebuggerPoll(void )
  1283. ;
  1284.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1285.         Macro
  1286.         _DebuggerPoll
  1287.             moveq               #3,D0
  1288.             dc.w                $A08D
  1289.         EndM
  1290.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1291.         IMPORT_CFM_FUNCTION DebuggerPoll
  1292.     ENDIF
  1293.  
  1294. ;
  1295. ; pascal PageState GetPageState(const void *address)
  1296. ;
  1297.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1298.         ; parameters:
  1299.         ;    address         => A0
  1300.         ; returns:
  1301.         ;    PageState       <= D0
  1302.         Macro
  1303.         _GetPageState
  1304.             moveq               #4,D0
  1305.             dc.w                $A08D
  1306.         EndM
  1307.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1308.         IMPORT_CFM_FUNCTION GetPageState
  1309.     ENDIF
  1310.  
  1311. ;
  1312. ; pascal Boolean PageFaultFatal(void )
  1313. ;
  1314.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1315.         ; returns:
  1316.         ;    Boolean         <= D0
  1317.         Macro
  1318.         _PageFaultFatal
  1319.             moveq               #5,D0
  1320.             dc.w                $A08D
  1321.         EndM
  1322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1323.         IMPORT_CFM_FUNCTION PageFaultFatal
  1324.     ENDIF
  1325.  
  1326. ;
  1327. ; pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
  1328. ;
  1329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1330.         ; parameters:
  1331.         ;    address         => A0
  1332.         ;    count           => A1
  1333.         ; returns:
  1334.         ;    OSErr           <= D0
  1335.         Macro
  1336.         _DebuggerLockMemory
  1337.             moveq               #6,D0
  1338.             dc.w                $A08D
  1339.         EndM
  1340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1341.         IMPORT_CFM_FUNCTION DebuggerLockMemory
  1342.     ENDIF
  1343.  
  1344. ;
  1345. ; pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
  1346. ;
  1347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1348.         ; parameters:
  1349.         ;    address         => A0
  1350.         ;    count           => A1
  1351.         ; returns:
  1352.         ;    OSErr           <= D0
  1353.         Macro
  1354.         _DebuggerUnlockMemory
  1355.             moveq               #7,D0
  1356.             dc.w                $A08D
  1357.         EndM
  1358.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1359.         IMPORT_CFM_FUNCTION DebuggerUnlockMemory
  1360.     ENDIF
  1361.  
  1362. ;
  1363. ; pascal StatusRegisterContents EnterSupervisorMode(void )
  1364. ;
  1365.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1366.         ; returns:
  1367.         ;    StatusRegisterContents <= D0
  1368.         Macro
  1369.         _EnterSupervisorMode
  1370.             moveq               #8,D0
  1371.             dc.w                $A08D
  1372.         EndM
  1373.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1374.         IMPORT_CFM_FUNCTION EnterSupervisorMode
  1375.     ENDIF
  1376.  
  1377.  
  1378. ;  
  1379. ;    StripAddress and Translate24To32 are traps on classic 68K,
  1380. ;    but macro to the identity function on PowerMacs or other OS's.
  1381. ;
  1382.  
  1383. ;
  1384. ; pascal Ptr StripAddress(void *theAddress)
  1385. ;
  1386.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1387.         ; parameters:
  1388.         ;    theAddress      => D0
  1389.         ; returns:
  1390.         ;    Ptr             <= D0
  1391.         _StripAddress:    OPWORD    $A055
  1392.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1393.         IMPORT_CFM_FUNCTION StripAddress
  1394.     ENDIF
  1395.  
  1396.  
  1397. ;
  1398. ; pascal Ptr Translate24To32(void *addr24)
  1399. ;
  1400.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1401.         ; parameters:
  1402.         ;    addr24          => D0
  1403.         ; returns:
  1404.         ;    Ptr             <= D0
  1405.         _Translate24To32:    OPWORD    $A091
  1406.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1407.         IMPORT_CFM_FUNCTION Translate24To32
  1408.     ENDIF
  1409.  
  1410. ;
  1411. ; pascal OSErr HandToHand(Handle *theHndl)
  1412. ;
  1413.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1414.         _HandToHand:    OPWORD    $A9E1
  1415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1416.         IMPORT_CFM_FUNCTION HandToHand
  1417.     ENDIF
  1418.  
  1419. ;
  1420. ; pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
  1421. ;
  1422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1423.         ; parameters:
  1424.         ;    srcPtr          => A0
  1425.         ;    dstHndl         => A1
  1426.         ;    size            => D0
  1427.         ; returns:
  1428.         ;    OSErr           <= D0
  1429.         _PtrToXHand:    OPWORD    $A9E2
  1430.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1431.         IMPORT_CFM_FUNCTION PtrToXHand
  1432.     ENDIF
  1433.  
  1434. ;
  1435. ; pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size)
  1436. ;
  1437.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1438.         _PtrToHand:    OPWORD    $A9E3
  1439.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1440.         IMPORT_CFM_FUNCTION PtrToHand
  1441.     ENDIF
  1442.  
  1443. ;
  1444. ; pascal OSErr HandAndHand(Handle hand1, Handle hand2)
  1445. ;
  1446.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1447.         ; parameters:
  1448.         ;    hand1           => A0
  1449.         ;    hand2           => A1
  1450.         ; returns:
  1451.         ;    OSErr           <= D0
  1452.         _HandAndHand:    OPWORD    $A9E4
  1453.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1454.         IMPORT_CFM_FUNCTION HandAndHand
  1455.     ENDIF
  1456.  
  1457. ;
  1458. ; pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
  1459. ;
  1460.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1461.         ; parameters:
  1462.         ;    ptr1            => A0
  1463.         ;    hand2           => A1
  1464.         ;    size            => D0
  1465.         ; returns:
  1466.         ;    OSErr           <= D0
  1467.         _PtrAndHand:    OPWORD    $A9EF
  1468.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1469.         IMPORT_CFM_FUNCTION PtrAndHand
  1470.     ENDIF
  1471.  
  1472.     IF OLDROUTINENAMES THEN
  1473.     ENDIF    ; OLDROUTINENAMES
  1474.     ENDIF ; __MACMEMORY__ 
  1475.  
  1476.